package de.lusiardi.webdav.headers;

import java.util.logging.Logger;

public class DavHeader implements Header {

    private static final Logger logger = Logger.getLogger(DavHeader.class.getCanonicalName());

    public static final String KEY = "DAV";

    private String value;

    public String getKey() {
        return KEY;
    }

    public void setValue(String val) {
        value = val;
        if (!checkValue()) {
            logger.warning(String.format("'%s' is an invalid value for DAV header.", value));
        }
    }

    public String getValue() {
        return value;
    }

    /**
     * <pre>DAV              = "DAV" ":" #( compliance-class )
     * compliance-class = ( "1" | "2" | "3" | extend )
     * extend           = Coded-URL | token
     * ; token is defined in RFC 2616, Section 2.2
     * Coded-URL        = "<" absolute-URI ">"
     * ; No linear whitespace (LWS) allowed in Coded-URL
     * ; absolute-URI defined in RFC 3986, Section 4.3</pre>
     *
     * @return
     */
    public boolean checkValue() {
        return true;
    }
}
